<!doctype html>
<html lang="en">
<head>
    <title>登录到ranter水果店</title>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="css/bootstrap.css">
    <style>
        .container{
            margin-top: 10px;
        }
        .navbar{
            margin-bottom: 20px;
        }
        h3 span{
            font-size:40px;
            color: #f33f00;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default" style="padding-top: 15px;">
    <div class="container" style="margin-bottom: 4px;">
        <div class="row">
            <div class="col-lg-4">
                <img src="images/first.png" alt="" width="">
            </div>
            <div class="col-lg-4 col-lg-offset-2">
                <div class="input-group">
                    <input name="searchName" type="text" style="border: 2px solid #76ac25;border-right: none;" class="form-control" placeholder="输入商品名称进行搜索">
                    <span class="input-group-btn">
                     <button id="search" style="color: white;font-weight:bold;background: #76ac25;" class="btn btn-default" type="button">搜索</button>
                    </span>
                </div>
            </div>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/gouwuche">购物车</a></li>
                <li><a href="/login"><span id="un"><%= UserName%></span></a></li>
                <li><a href="/zhuce">注册</a></li>
            </ul>
        </div>

    </div>
</nav>
<div class="container">
    <h2>购物车列表</h2>

    <%for(var j = 0; j< st.length; j ++){%>
            <blockquote>
            <div class="media">
                <div class="media-left media-middle">
                    <a href="#">
                        <img class="media-object" src="<%= st[j].spMiaoshu.src%>" alt="...">
                    </a>
                </div>

                <div class="media-body">
                    <h4 class="media-heading"><%= st[j].spMiaoshu.spMiaoshu%></h4>
                    <p>数量：<%=st[j].count%><span></span></p>
                    <p id="jiage">价格：<%=st[j].spMiaoshu.jiage%><span>元</span></p>
                    单品合计：<span class="heji"><%=st[j].money%>元</span>
                    <button style="float: right" type="button" class="btn btn-danger yichu">移除购物车</button>
                </div>

            </div>
            </blockquote>
        <%}%>

    <h3>合计金额:<span><%=heji%></span>元</h3>

</div>
<script type="text/template" id="moban">

</script>
<script src="js/jquery-3.2.0.js"></script>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>-->
<script src="js/bootstrap.js"></script>
<script src="js/underscore-noflect.js"></script>
<script>
    $(".yichu").click(function(){
        $.post('/yichu',{
            "spMiaoshu":$(this).siblings('h4').text(),
            "UserName" : $("#un").text()
        },function (err, result) {
            window.location.href = "/gouwuche"
        })
    })
</script>
</body>
</html>